<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>学生列表</title>
    <link href="../../static/css/bootstrap.min.css" rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}">
    <link href="../../static/css/dashboard.css" rel="stylesheet" th:href="@{/static/css/dashboard.css}">
</head>
<body>
<div th:insert="admin/common::topbar"></div>
<div class="container-fluid">
    <div class="row">
        <!--侧边栏-->
        <div th:insert="~{admin/common::sidebar(active='classInfo.html')}"></div>
        <main class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
                <h1 class="h3">班级详情</h1>
                <div class="btn-toolbar mb-2 mb-md-0">
                    <div class="btn-group mr-2">
                        <button class="btn btn-primary btn-sm btn-outline-secondary" id="btn-admin">管理员</button>
                        <button class="btn btn-sm btn-outline-secondary" id="btn-student">学生端</button>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <thead>
                    <tr>
                        <th>学号</th>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>民族</th>
                        <th>班级</th>
                        <th>年级</th>
                        <th>入学时间</th>
                        <th>毕业时间</th>
                        <!-- <th>学习状态</th>-->
                        <!--<th>年级</th>-->
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="list:${List}">
                        <th><a th:href="@{/admin/getStudent/{sno}/(sno=${list.getSno()})}"
                               th:text="${list.getSno()}"></a></th>
                        <th><a th:href="@{/admin/getStudent/{sno}/(sno=${list.getSno()})}"
                               th:text="${list.getSname()}"></a></th>
                        <th th:text="${list.getSex()}"></th>
                        <th th:text="${list.getNatice()}"></th>
                        <th th:text="${list.getSclass()}"></th>
                        <th th:text="${list.getGrade()}"></th>
                        <th th:text="${#dates.format(list.getEntrance(),'yyyy-MM-dd')}"></th>
                        <th th:text="${#dates.format(list.getGraduate(),'yyyy-MM-dd')}"></th>
                        <!-- <th th:text="${list.getState()}"></th>-->
                    </tr>
                    </tbody>
                </table>
            </div>
            <!-- <nav class="page-header"  aria-label="Page navigation">
                 <ul class="pagination">
                     <li>
                         <a id="pagePrevious" th:href="@{/admin/getStudentListByClass/{class_name}/{page}/(class_name=${class_name},page=${page}-1)}" th:if="${lastPage}" aria-label="Previous">
                             <span aria-hidden="true">&laquo;</span>
                         </a>
                     </li>
                     <li><a id="page1" class="nav active" th:href="@{/admin/getStudentListByClass/{class_name}/{page}/(class_name=${class_name},page=${page})}" th:if="${number} gt ${10}"  th:text="${page}"></a></li>
                     <li><a id="page2" th:href="@{/admin/getStudentListByClass/{class_name}/{page}/(class_name=${class_name},page=${page+1})}" th:if="${number} gt ${page*10}" th:text="${page}+1"></a></li>
                     <li><a id="page3" th:href="@{/admin/getStudentListByClass/{class_name}/{page}/(class_name=${class_name},page=${page+2})}" th:if="${number} gt ${(page+1)*10}" th:text="${page}+2"></a></li>
                     <li><a id="page4" th:href="@{/admin/getStudentListByClass/{class_name}/{page}/(class_name=${class_name},page=${page+3})}" th:if="${number} gt ${(page+2)*10}" th:text="${page}+3"></a></li>
                     <li><a id="page5" th:href="@{/admin/getStudentListByClass/{class_name}/{page}/(class_name=${class_name},page=${page+4})}" th:if="${number} gt ${(page+3)*10}" th:text="${page}+4"></a></li>
                     <li>
                         <a id="pageNext" th:href="@{/admin/getStudentListByClass/{class_name}/{page}/(class_name=${class_name},page=${page}+1)}" th:if="${nextPage}"  aria-label="Next" >
                             <span aria-hidden="true">&raquo;</span>
                         </a>
                     </li>
                 </ul>
             </nav>-->
        </main>
    </div>
</div>
<script src="../../static/js/jquery-3.6.0.min.js" th:src="@{/static/js/jquery-3.6.0.min.js}"
        type="text/javascript"></script>
<script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
<script>
    $(function () {

        $('#btn-admin').click(function () {
            let result = confirm("是否进入管理员登录?");
            if (result === true) {
                $(location).attr('href', '/adminLogin.html');
            } else {

            }
        })
        $('#btn-student').click(function () {
            let result = confirm("是否重新登录?");
            if (result === true) {
                $(location).attr('href', '/studentLogin.html');
            } else {

            }
        })
    })
</script>
</body>
</html>